package com.example.administrator.myapplication.View.Activity;

import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.example.administrator.myapplication.Bean.Notice;
import com.example.administrator.myapplication.Presenter.NoticePresenter;
import com.example.administrator.myapplication.R;
import com.example.administrator.myapplication.View.Fragment.INoticeView;
import com.example.administrator.myapplication.View.layout.MineItemView;
import com.example.administrator.myapplication.View.layout.NoticeItemView;

import java.text.SimpleDateFormat;
import java.util.List;

/**
 * Created by Administrator on 2019/10/8 0008.
 */

public class NoticeDetailActivity extends AppCompatActivity implements View.OnClickListener{
    private TextView tv_back;
    private TextView toolbar_title;
    private TextView tv_title;
    private TextView tv_content;
    private TextView tv_author;
    private TextView tv_time;
    private Notice notice;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_notice_detail);
        if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.LOLLIPOP){
            getWindow().setStatusBarColor(Color.parseColor("#d16d26"));
        }
        initView();
    }

    private void initView() {
        tv_back = findViewById(R.id.toolbar_back);
        toolbar_title = findViewById(R.id.toolbar_title);
        tv_title = findViewById(R.id.tv_title);
        tv_time = findViewById(R.id.tv_time);
        tv_content = findViewById(R.id.tv_content);
        tv_author = findViewById(R.id.tv_author);
        notice = (Notice) getIntent().getSerializableExtra("notice");
        toolbar_title.setText("详细信息");
        tv_title.setText(notice.getNoticeTitle());
        tv_content.setText(notice.getNoticeContent());
        tv_author.setText(notice.getCreateBy());
        tv_time.setText(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(notice.getUpdateTime()));
        tv_back.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.toolbar_back:
                finish();
                break;
        }
    }

}
